---
layout: m1x_soap
title: Product Custom Value Remove
---

<h3><a name="product_custom_option_value.remove-Module%3AComplexProductAPI"></a>Module: Complex Product API</h3>


<h4><a name="product_custom_option_value.remove-Resource%3Aproductcustomoptionvalue"></a>Resource: product_custom_option_value</h4>


<h5><a name="product_custom_option_value.remove-Method%3A"></a>Method:</h5>

<ul>
	<li>product_custom_option_value.remove (SOAP V1)</li>
	<li>catalogProductCustomOptionValueRemove (SOAP V2)</li>
</ul>


<p>Allows you to remove the custom option value from a product.</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId <br class="atl-forced-newline" /> </td>
<td> Session ID </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> valueId </td>
<td> Custom option value ID </td>
</tr>
</tbody></table>


<p><b>Return:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Description </th>
</tr>
<tr>
<td> boolean\int </td>
<td> True (1) if the custom option value is removed </td>
</tr>
</tbody></table>


<p><b>Faults:</b></p>

<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 103 </td>
<td> Option with requested id does not exist. </td>
</tr>
<tr>
<td> 106 </td>
<td> Can not delete option. </td>
</tr>
<tr>
<td> 109 </td>
<td> Option should have at least one value. Can not delete last value. </td>
</tr>
</tbody></table>


<h4><a name="product_custom_option_value.remove-Examples"></a>Examples</h4>

<h5><a name="product_custom_option_value.remove-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$productOptionId = 4;// Existing option ID
// Get last value from option values list
$optionValues = $proxy-&gt;call($sessionId, "product_custom_option_value.list", array($productOptionId));
$optionValue = reset($optionValues);
$valueId = $optionValue['value_id'];

$result = $proxy-&gt;call(
    $sessionId,
    "product_custom_option_value.remove",
    array(
         $valueId
    )
);</pre>
		</div>
</div></div>

<h5><a name="product_custom_option_value.remove-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy-&gt;catalogProductCustomOptionValueRemove($sessionId, '4');
var_dump($result);</pre>
		</div>
</div></div>



<h5><a name="product_custom_option_value.remove-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey'));

$result = $proxy-&gt;catalogProductCustomOptionValueRemove((object)array('sessionId' =&gt; $sessionId-&gt;result, 'valueId' =&gt; '4'));
var_dump($result-&gt;result);</pre>
		</div>
</div></div>


